#include <iostream>
#include "student.h"
using namespace std;
#include "SortTestHelper.h"
template <typename T>
void SelectionSort(T arr[],int n){

    for(int i=0;i<n;i++){
        //查找[i,n)的最小值
        int minIndex=i;
        for(int j=i+1;j<n;j++)
            if(arr[j]<arr[minIndex])
                minIndex=j;
        swap(arr[i],arr[minIndex]);
    }

}
int main() {
//        int arr[]={2,7,8,8,4,9,1,10,25,55};
//        string s[]={"A","B","C","D"};
    Student d[4]={{12,"B"},{88,"T"},{34,"D"},{88,"A"}};
    SelectionSort(d,4);
    for(int i=0;i<4;i++)
        cout<<d[i]<<endl;
//    int N=20000;
//    int* arr=SortTestHelper::generateRandomArray(N,0,N);
//    SelectionSort(arr,N);
//    SortTestHelper::printfArray(arr,N);
//    SortTestHelper::testSort("Select sort",SelectionSort,arr,N);
//    delete[] arr;
    return 0;
}